﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FormVanBanDieuHanh.aspx.cs"
    Inherits="AIC_KQKT.FormVanBanDieuHanh" MasterPageFile="~/Site1.Master" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">
    <script>
        $(function() {
            $("#<%= dtpFromDate.ClientID %>").datepicker();
            $("#<%= dtpToDate.ClientID %>").datepicker();
            $("#<%= dtpBanHanhFrom.ClientID %>").datepicker();
            $("#<%= dtpBanHanhTo.ClientID %>").datepicker();
            $("#<%= dtpDateNew.ClientID %>").datepicker();
            $("#<%= dtpFromDateNew.ClientID %>").datepicker();
            $("#<%= dtpToDateNew.ClientID %>").datepicker();
        });
        jQuery(document).ready(function() {
            jQuery(".content").hide();
            //toggle the componenet with class msg_body
            jQuery(".heading").click(function() {
                jQuery(this).next(".content").slideToggle(500);
            });
        });
    </script>

    <div id="Div1" class="FormTitle" runat="server">
        <p class="TextTitle">
            <label id="lblFormName" runat="server">
                Văn bản điều hành
            </label>
            <asp:ImageButton CssClass="btnExit" ID="ImageButton1" runat="server" ImageUrl="Images/exit.png"
                Height="24px" OnClick="ImageButton1_Click" />
        </p>
    </div>
    <div class="FormMain">
        <div class="Form Search">
            <div class="FormSearchRight">
                <img alt="" src="Images/SearchCDQP.jpg" />
                <div class="FormSearchLeft">
                    <h2>
                        Tìm kiếm tài liệu, văn bản</h2>
                    <p>
                        Nhập tên tài liệu, văn bản hoặc từ khóa liên quan đến tài liệu, văn bản vào cửa
                        số tìm kiếm dưới đây</p>
                    <table>
                        <tr>
                            <td>
                                <asp:TextBox ID="txtSearch" runat="server" CssClass="SearchText"></asp:TextBox>
                            </td>
                            <td>
                                <asp:ImageButton ID="btnSearch" runat="server" OnClick="btnSearch_Click" ImageUrl="~/Images/btnSearch.png"
                                    Width="110px" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                Tìm kiếm trong các trường : 
                                <asp:CheckBox ID="chkSoHieu" runat="server" Text="Số hiệu" Checked="True" />
                                <asp:CheckBox ID="chkTenTaiLieu" runat="server" Text="Tên tài liệu" 
                                    Checked="True"/>
                                <asp:CheckBox ID="chkTrichYeu" runat="server" Text="Trích yếu" Checked="True"/>
                                <asp:CheckBox ID="chkNoiDung" runat="server" Text="Nội dung" Checked="True"/>
                            </td>
                        </tr>
                    </table>
                    <p class="heading">
                        Thêm các điều kiện :</p>
                    <table>
                        <tr>
                            <td>
                                Ngày ban hành từ :
                            </td>
                            <td>
                                <asp:TextBox ID="dtpBanHanhFrom" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Ngày ban hành đến :
                            </td>
                            <td>
                                <asp:TextBox ID="dtpBanHanhTo" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Có hiệu lực từ :
                            </td>
                            <td>
                                <asp:TextBox ID="dtpFromDate" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Có hiệu lực đến :
                            </td>
                            <td>
                                <asp:TextBox ID="dtpToDate" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                    <p class="heading">
                        Tìm kiếm nâng cao</p>
                    <div class="content">
                        <table class="SearchTable" width="80%">
                            <tr>
                                <td runat="server" id="TaiLieuID2_DMF">
                                    <asp:Label ID="TaiLieuID2_DM" runat="server" Text="Label"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlTaiLieuID2_DMF" runat="server" CssClass="ControlDropdown MaxWidth">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td runat="server" id="TaiLieuID3_DMF">
                                    <asp:Label ID="TaiLieuID3_DM" runat="server" Text="Label"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlTaiLieuID3_DMF" runat="server" CssClass="ControlDropdown MaxWidth">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td runat="server" id="TaiLieuID4_DMF">
                                    <asp:Label ID="TaiLieuID4_DM" runat="server" Text="Label"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlTaiLieuID4_DMF" runat="server" CssClass="ControlDropdown MaxWidth">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td runat="server" id="TaiLieuID5_DMF">
                                    <asp:Label ID="TaiLieuID5_DM" runat="server" Text="Label"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlTaiLieuID5_DMF" runat="server" CssClass="ControlDropdown MaxWidth">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td runat="server" id="TaiLieuID6_DMF">
                                    <asp:Label ID="TaiLieuID6_DM" runat="server" Text="Label"></asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlTaiLieuID6_DMF" runat="server" CssClass="ControlDropdown MaxWidth">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="Form Update" runat="server" id="formUpdate" visible="false">
            <table border="1px" class="ListForm MaxWidth">
                <tr>
                    <td class="style1">
                        Số hiệu
                    </td>
                    <td class="style2">
                        <asp:TextBox ID="txtSoHieu" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Tên tài liệu
                    </td>
                    <td>
                        <asp:TextBox ID="txtTenTaiLieu" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Ngày ban hành
                    </td>
                    <td>
                        <asp:TextBox ID="dtpDateNew" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Hiệu lực từ
                    </td>
                    <td>
                        <asp:TextBox ID="dtpFromDateNew" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Hiệu lực đến
                    </td>
                    <td>
                        <asp:TextBox ID="dtpToDateNew" runat="server" CssClass="SearchBox InputText"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        File đính kèm
                    </td>
                    <td>
                        <asp:FileUpload ID="fulTaiLieu" runat="server" CssClass="SearchBox InputText" />
                        <asp:LinkButton ID="lbtFileDinhkem" runat="server" OnClick="lbtFileDinhkem_Click"></asp:LinkButton>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblTaiLieuD1_DMNew" runat="server" Text="Label"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTaiLieuID1_DMFNew" runat="server" CssClass="ControlDropdown MaxWidth">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblTaiLieuD2_DMNew" runat="server" Text="Label"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTaiLieuID2_DMFNew" runat="server" CssClass="ControlDropdown MaxWidth">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblTaiLieuD3_DMNew" runat="server" Text="Label"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTaiLieuID3_DMFNew" runat="server" CssClass="ControlDropdown MaxWidth">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblTaiLieuD4_DMNew" runat="server" Text="Label"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTaiLieuID4_DMFNew" runat="server" CssClass="ControlDropdown MaxWidth">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblTaiLieuD5_DMNew" runat="server" Text="Label"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTaiLieuID5_DMFNew" runat="server" CssClass="ControlDropdown MaxWidth">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblTaiLieuD6_DMNew" runat="server" Text="Label"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTaiLieuID6_DMFNew" runat="server" CssClass="ControlDropdown MaxWidth">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        Trích yếu
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <FCKeditorV2:fckeditor ID="txtTrichYeu" runat="server" Height="300" ToolbarStartExpanded="false">
                        </FCKeditorV2:fckeditor>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        Nội dung
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <FCKeditorV2:fckeditor ID="txtNoiDung" runat="server" Height="300" ToolbarStartExpanded="false">
                        </FCKeditorV2:fckeditor>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:Button ID="btnLuu" runat="server" Text="Lưu lại" CssClass="cmdBtn" OnClick="btnLuu_Click" />
                        <asp:Button ID="btnHuy" runat="server" Text="Hủy" CssClass="cmdBtn" OnClick="btnHuy_Click" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="Form View">
            <asp:Button ID="btnThem" runat="server" Text="Thêm mới" CssClass="cmdBtn" OnClick="btnThem_Click" />
            <asp:GridView ID="grdDanhMuc" runat="server" AutoGenerateColumns="False" CssClass="ListTable"
                DataKeyNames="IDTaiLieu" OnRowCommand="grdDanhMuc_RowCommand">
                <Columns>
                    <asp:TemplateField HeaderText="#">
                        <ItemTemplate>
                            <asp:Label ID="lblIDDM" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tên tài liệu">
                        <ItemTemplate>
                            <asp:LinkButton ID="lblMaDM" runat="server" PostBackUrl='<%# "FormXemVanBan.aspx?ID="+Eval("IDTaiLieu") %>'><%# Eval("TenTaiLieu") %></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle Width="600px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="NgayBanHanh" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày ban hành" />
                    <asp:BoundField DataField="HieuLucTu" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Có hiệu lực từ" />
                    <asp:BoundField DataField="HieuLucDen" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Có hiệu lực đến" />
                    <asp:TemplateField HeaderText="Sửa">
                        <ItemTemplate>
                            <asp:ImageButton ID="lbtEdit" runat="server" ImageUrl="images/edit.gif" CommandName="<%# AIC_KQKT.MyConst.Action.Update %>"
                                CommandArgument='<%# Eval("IDTaiLieu") %>'></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa">
                        <ItemTemplate>
                            <asp:ImageButton ID="lbtDelete" runat="server" ImageUrl="images/delete.png" CommandName="<%# AIC_KQKT.MyConst.Action.Delete %>"
                                OnClientClick="return confirm('Bạn có chắc là muốn xóa bản ghi này không ?')"
                                CommandArgument='<%# Eval("IDTaiLieu") %>'></asp:ImageButton>
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
